package com.sw.haruka.module.ftp.viewmodel

import androidx.databinding.ObservableBoolean
import androidx.databinding.ObservableField
import androidx.lifecycle.ViewModel
import com.sw.haruka.module.ftp.manager.FtpServerManager

/**
 * Created by Swsbty on 2021/05/01
 */
class FtpViewModel : ViewModel() {

    val offset = ObservableBoolean(false)

    val info = ObservableField("")

    fun startInfo(ip: String) {
        offset.set(true)
        val text = "FTP服务已开启\n请在浏览器地址栏输入：\nftp://$ip:${FtpServerManager.getInstance().port}"
        info.set(text)
    }

    fun stopInfo(text: String = "") {
        offset.set(false)
        info.set(text)
    }

}